package com.yh.patterns.combination.AO;

import java.util.ArrayList;

public class ConcreteCompany extends Company {
    private ArrayList list = new ArrayList();
    private String name;

    public ConcreteCompany(String name){
        super(name);
        this.name = name;
    }
    @Override
    public void release() {
        System.out.println("公文下发至"+name);
        for(Object object : list){
            ((Company)object).release();
        }
    }
    public void add(Company c){
        list.add(c);
    }
    public void remove(Company c){
        list.remove(c);
    }
}
